using Core.Domain.Lexems;

namespace Core.Domain
{
    public class CompilerError
    {
        public CompilerError(int number, string message, int row, int column)
        {
            Number = number;
            Message = message;
            Row = row;
            Column = column;
        }

        public CompilerError(int number, string message, Lexem lex)
        {
            Number = number;
            Message = message;
            if (lex != null)
            {
                Row = lex.PosInText.Row;
                Column = lex.PosInText.Column;
            }
        }

        public int Number { get; private set; }
        public string Message { get; private set; }
        public int Row { get; private set; }
        public int Column { get; private set; }
    }
}